import openpyxl

my_excel = openpyxl.load_workbook(r".\my_test.xlsx")
my_sheet1 = my_excel['Sheet1']
# value = my_sheet1.cell(1,2).value
# print(value)

# 获取工作表中的最大行数及列数
print("最大行数:",my_sheet1.max_row)
print("最大列数：",my_sheet1.max_column)
values = []
for j in range(2, my_sheet1.max_row+1):
    dic = {}
    for i in range(1, my_sheet1.max_column+1):
        dic[my_sheet1.cell(1, i).value] = my_sheet1.cell(j, i).value
    values.append(dic)
print(values)